<?php

namespace App\Http\Controllers\Home;

use Illuminate\Http\Request;
use DB;
use App\Http\Requests;
use App\Http\Controllers\Controller;

use App\User;

class TopicController extends Controller
{
   public function index()
   {
        session(['id'=>1]);
        $id=session('id');
        //获得已关注的话题数
        $num=DB::table('topfocus')->where('user_id',$id)->count();
        //查看所有已经关注的话题
        $user = User::find($id);
        // dd($user);
        // dd($res);
        //解析模板
        return view('Home.topic.index',['id'=>$id,'num'=>$num,'user'=>$user]);

        
       

   }
}
